package com.ymttest.database.sqlwapper;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.Ymt_ExpressSellerToMode;
import com.ymttest.utils.EnvSetup;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/************************************************************************************
 * @File name : YmtUserWapper.java
 * @Author : zhouyi
 * @Date : 2015年4月2日
 * @Copyright : 洋码头
 ************************************************************************************/
public class Ymt_ExpressSellerToModeWapper {
	SqlManager manage;

	public Ymt_ExpressSellerToModeWapper() {
		manage = new SqlManager("ymt" + EnvSetup.getEnv());
	}

	//根据品牌ID查询品牌信息
	public List<Map> selectbySellerId(Integer sellerId)
			throws InterruptedException {
		@SuppressWarnings("unchecked")
		List<Map> map = manage
				.getSelectResults(
						"com.ymttest.database.mapping.Ymt_ExpressSellerToModeMapper.selectbySellerId",
						sellerId);
		manage.commit();
		return map;
	}
	 public int insert(Ymt_ExpressSellerToMode record)throws InterruptedException {
		int result= manage
				.insert(
						"com.ymttest.database.mapping.Ymt_ExpressSellerToModeMapper.insert",
						record);
		manage.commit();
		return result;
	 }
	 
	 
	 public int updateBySellerIdAndStatus(int sellerId,int catalogStatus,boolean isDelete)throws InterruptedException {
		HashMap<String,Object> map=new HashMap<String,Object>();
    	map.put("sellerId", sellerId);
    	map.put("catalogStatus", catalogStatus);
    	map.put("isDelete", isDelete);
		int result= manage
				.insert(
						"com.ymttest.database.mapping.Ymt_ExpressSellerToModeMapper.updateBySellerIdAndStatus",
						map);
		manage.commit();
		return result;
	 }
	public static void main(String args[]) throws Exception{
		List<Map> map = new Ymt_ExpressSellerToModeWapper().selectbySellerId(3383);
		System.out.println(map.get(0));
	}
}
